<!DOCTYPE html>

<html>
	<head>
		<title>Ymnets-Admin</title>
		<meta charset="utf-8" />
		<meta name="renderer" content="webkit" />
		<meta name="viewport" content="width=device-width" />

		<link href="css/themes/base/easyui.css" rel="stylesheet" />

		<!-- 以下3个CSS文件需要动态加载 -->
		<!-- <link href="css/themes/skin-coolblack.css" rel="stylesheet" /> -->
		<!-- <link href="css/site.css" rel="stylesheet" /> -->
		<!-- <link href="css/fontawesome/css/font-awesome.min.css" rel="stylesheet" /> -->

		<script src="js/utils/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/easyui/jquery.easyui.plus.js" charset="utf-8"></script>
		<script src="js/easyui/easyui-lang-zh-CN.js" type="text/javascript"></script>
		<script src="js/utils/common.js" type="text/javascript" charset="UTF-8"></script>
		<script src="js/utils/baseUrl.js"></script>
		<script src="js/index.js" type="text/javascript" charset="UTF-8"></script>
		<script type="text/javascript" charset="UTF-8">
			$(function() {
				//获取主题
				var theme = window.localStorage.getItem("theme");
				console.log("主题：" + theme)
				if (!theme) {
					theme = "coolblack";
				}
				//动态加载主题
				dynamicLoadCss('css/themes/skin-' + theme + '.css');
				//由于以下两个CSS引用需要在主题之后，因此也必须动态引用进来
				dynamicLoadCss('css/site.css');
				dynamicLoadCss('css/fontawesome/css/font-awesome.min.css');
			});

			$(function() {
				//获取菜单样式
				var menu = window.localStorage.getItem("menu");
				console.log("菜单样式：" + menu)

				//获取顶部菜单是否显示配置
				var topmenu = window.localStorage.getItem("topmenu");
				console.log("顶部菜单是否显示配置：" + topmenu)
				var topMenuFlag = false;
				if (topmenu == "true") {
					topMenuFlag = true;
				}

				if (menu == "tree") {
					http.ajax("post", "/" + _YMGlobal.Config.currentCulture + "/Home/GetTopMenu", {}, function(data) { //获取顶级菜单

						//console.log(data);

						//开启顶部菜单模式
						var parentId = topMenuFlag ? data[0].id : "0";
						if (topMenuFlag) {
							var topmenuHtml = "";
							for (var i = 0; i < data.length; i++) {
								topmenuHtml = topmenuHtml + '<td id="' + data[i].id + '" class="topmenu  ' + (i == 0 ? 'selected' : '') +
									'" ><a onclick="loadTreeMenu(\'' + data[i].id + '\')"  title="' + data[i].text +
									'" class="l-btn-text bannerMenu" href="#"><lable class="' + data[i].iconCls +
									'"></lable><br /><span style="white-space:nowrap;">' + data[i].text + '</span></a></td>';
							}
							//填充顶部菜单
							$("#topmenucontent").html(topmenuHtml);
						}
						//加载左侧菜单
						loadTreeMenu(parentId);
					});
				} else {
					$("#RightAccordion").accordion({ //初始化accordion
						fillSpace: true,
						fit: true,
						border: false,
						animate: false
					});

					http.ajax("post", "/" + _YMGlobal.Config.currentCulture + "/Home/GetTopMenu", {}, function(data) { //获取顶级菜单
						//console.log(data);

						//开启顶部菜单模式
						var parentId = topMenuFlag ? data[0].id : "0";
						if (topMenuFlag) {
							var topmenuHtml = "";
							for (var i = 0; i < data.length; i++) {
								topmenuHtml = topmenuHtml + '<td id="' + data[i].id + '" class="topmenu  ' + (i == 0 ? 'selected' : '') +
									'" ><a onclick="loadAccordionMenu(\'' + data[i].id + '\')"  title="' + data[i].text +
									'" class="l-btn-text bannerMenu" href="#"><lable class="' + data[i].iconCls +
									'"></lable><br /><span style="white-space:nowrap;">' + data[i].text + '</span></a></td>';
							}
							//填充顶部菜单
							$("#topmenucontent").html(topmenuHtml);
						}
						//加载左侧菜单
						loadAccordionMenu(parentId);
					});
					$("#RightAccordion ").parent().css("overflow", "hidden"); //外部隐藏
				}
			});
		</script>

	</head>
	<body class="easyui-layout" id="easyLayout">

		<div id="modalwindow" class="easyui-window" data-options="closed:true,minimizable:false,shadow:false,collapsible:true">
		</div>

		<div id="north" data-options="region:'north',border:false,split:false" style="height: 50px; padding:0;margin:0">
			<table class="banner" style="border-spacing:0px;">
				<tr>
					<td class="webname">
						<span class="fa fa-yelp" style="font-size:26px; padding-right:8px;"></span>Ymnets-Admin
					</td>
					<td>
						<table id="topmenucontent" cellpadding="0" cellspacing="0"></table>
					</td>
					<td>&nbsp;</td>
					<td style="width: 80px;">
						<a title="切换主题" id="SetThemes" class="l-btn-text fa fa-cogs fa-lg bannerbtn" href="#"> </a>
					</td>
					<td style="width:182px; overflow:hidden; ">
						<a id="showUserInfo" style="display:inline-block;" class="fa bannerbtn" href="javascript:void(0);">
							<img src="img/userlogo.jpg" class="user-image" alt="User Image">
							<span class="user-name">作者</span>
						</a>
					</td>
				</tr>
			</table>
		</div>

		<div id="west" data-options="region:'west',split:true,title:'MAIN NAVIGATION',collapsible:false" style="width: 220px; height: 100%;  overflow: auto; border-bottom:0px;">
			<div id="RightAccordion" class="easyui-accordion"></div>
			<div id="RightTree" class="easyui-tree"></div>
		</div>

		<div id="center" data-options="region:'center',border:false">
			<div id="mainTab" class="easyui-tabs" data-options="fit:true"></div>
		</div>

		<div id="tab_menu" class="easyui-menu" style="width: 150px;">
			<div id="tab_menu-tabrefresh" data-options="iconCls:'icon-reload'">刷新</div>
			<div id="tab_menu-openFrame">在新的窗体打开</div>
			<div id="tab_menu-tabcloseall">关闭所有</div>
			<div id="tab_menu-tabcloseother">关闭其他标签页</div>
			<div class="menu-sep"></div>
			<div id="tab_menu-tabcloseright">关闭右边</div>
			<div id="tab_menu-tabcloseleft">关闭左边</div>
			<div id="tab_menu-tabclose" data-options="iconCls:'fa fa-trash'">关闭</div>
			<div id="menu" class="easyui-menu" style="width: 150px;"></div>
		</div>

		<div id="ModalStyle" class="easyui-dialog" style="width:600px;height:340px" data-options="iconCls:'fa fa-save',modal:true,closed:true">
			<table style="width:100%; padding:20px; line-height:30px;text-align:center;">
				<tr>
					<td>
						<img src="img/skin/skin-coolblack.png" style="width:60px;height:30px;" /><br /><input type="radio" name="themes"
						 value="coolblack" checked="checked" />
					</td>
					<td>
						<img src="img/skin/skin-red.png" style="width:60px;height:30px;" /><br /><input type="radio" name="themes" value="red" />
					</td>
					<td>
						<img src="img/skin/skin-green.png" style="width:60px;height:30px;" /><br /><input type="radio" name="themes"
						 value="green" />
					</td>
					<td>
						<img src="img/skin/skin-purple.png" style="width:60px;height:30px;" /><br /><input type="radio" name="themes"
						 value="purple" />
					</td>
					<td>
						<img src="img/skin/skin-blue.png" style="width:60px;height:30px;" /><br /><input type="radio" name="themes" value="blue" />
					</td>
					<td>
						<img src="img/skin/skin-yellow.png" style="width:60px;height:30px;" /><br /><input type="radio" name="themes"
						 value="yellow" />
					</td>
				</tr>
				<tr>
					<td>
						<img src="img/skin/skin-coolblacklight.png" style="width:60px;height:30px;" /><br /><input type="radio" name="themes"
						 value="coolblacklight" />
					</td>
					<td>
						<img src="img/skin/skin-redlight.png" style="width:60px;height:30px;" /><br /><input type="radio" name="themes"
						 value="redlight" />
					</td>
					<td>
						<img src="img/skin/skin-greenlight.png" style="width:60px;height:30px;" /><br /><input type="radio" name="themes"
						 value="greenlight" />
					</td>
					<td>
						<img src="img/skin/skin-purplelight.png" style="width:60px;height:30px;" /><br /><input type="radio" name="themes"
						 value="purplelight" />
					</td>
					<td>
						<img src="img/skin/skin-bluelight.png" style="width:60px;height:30px;" /><br /><input type="radio" name="themes"
						 value="bluelight" />
					</td>
					<td>
						<img src="img/skin/skin-yellowlight.png" style="width:60px;height:30px;" /><br /><input type="radio" name="themes"
						 value="yellowlight" />
					</td>
				</tr>
			</table>
			<table style="width: 100%; padding: 20px; line-height: 30px; text-align: center;">
				<tr>
					<td><input type="radio" name="menustyle" value="accordion" checked="checked" />手风琴</td>
					<td><input type="radio" name="menustyle" value="tree" />树形</td>
					<td><input type="checkbox" checked="checked" name="topmenu" value="topmenu" />开启顶部菜单</td>
				</tr>
			</table>
			<div class="endbtndiv">
				<a id="btnSave" href="javascript:SetThemes()" class="easyui-linkbutton btns">保存</a>
				<a id="btnReturn" href="javascript:$('#ModalStyle').dialog('close')" class="easyui-linkbutton btnc">取消</a>
			</div>
		</div>

	</body>
</html>
